<!--<button nz-button nzType="primary" (click)="addRoot()" style="margin-bottom: 5px;" *ngIf="roleManager == 1">-->
<!--  <i nz-icon nzType="plus" nzTheme="outline"></i>新增根分类-->
<!--</button>-->
<ul id="{{treeId}}" class="ztree"></ul>
<!--设置-->
<nz-modal [(nzVisible)]="isVisible"
          nzWidth="530px"
          [nzTitle]="modalTitle"
          [nzContent]="modalContent"
          (nzOnCancel)="isVisible = false"
          [nzFooter]="footModel"
          nzMaskClosable="false"
>
  <ng-template #modalTitle>
    新增专业
  </ng-template>
  <ng-template #modalContent>
    <form nz-form [formGroup]="validateForm">
      <div nz-row>
        <div nz-col nzSpan="24">
          <nz-form-item>
            <nz-form-label [nzSm]="7">
              隶属
            </nz-form-label>
            <nz-form-control [nzSm]="16" [nzXs]="12">
              <nz-tree-select
                style="width: 100%"
                [nzNodes]="treeNodes"
                nzShowSearch
                nzPlaceHolder="默认选择根分类"
                nzDisabled
                formControlName="parentId"
                [(ngModel)]="newInfos.parentId"
              >
              </nz-tree-select>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="24">
          <nz-form-item>
            <nz-form-label nzRequired [nzSm]="7">
              专业名称
            </nz-form-label>
            <nz-form-control [nzSm]="16" [nzXs]="12">
              <input nz-input placeholder="请输入" [(ngModel)]="newInfos.name" formControlName="name"/>
              <nz-form-explain
                *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">
                <span [hidden]="!validateForm.hasError('required','name')">名称必填</span>
              </nz-form-explain>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="24">
          <nz-form-item>
            <nz-form-label nzRequired [nzSm]="7">
              类别
            </nz-form-label>
            <nz-form-control [nzSm]="16" [nzXs]="12">
              <nz-select style="width: 100%;" [(ngModel)]="newInfos.type" nzDisabled nzPlaceHolder="请选择" formControlName="type">
                <nz-option nzValue="0" nzLabel="学院"></nz-option>
                <nz-option nzValue="1" nzLabel="专业"></nz-option>
              </nz-select>
              <nz-form-explain
                *ngIf="validateForm.get('type').dirty && validateForm.get('type').errors">
                <span [hidden]="!validateForm.hasError('required','type')">类别必选</span>
              </nz-form-explain>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
    </form>
  </ng-template>
  <ng-template #footModel>
    <button nz-button nzType="default" (click)="isVisible = false">取消</button>
    <button nz-button nzType="primary" [disabled]="!validateForm.valid" (click)="submit()">保存</button>
  </ng-template>
</nz-modal>
